﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Web.UI.MobileControls;
using System.Xml.Serialization;

/// <summary>
///CustomDataArrayWebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class CustomDataArrayWebService : System.Web.Services.WebService
{
    public CustomDataArrayWebService()
    {
        //如果使用设计的组件，请取消注释以下行 
        //InitializeComponent(); 
    }

    [WebMethod]
    [XmlInclude(typeof (Address))]
    public List<Address> GetAddress()
    {
        List<Address> addresses = new List<Address>();
        Address address1 = new Address("Jiefang Road", "Ningbo", 315000, "CHINA");
        Address address2 = new Address("Zhongshan Road", "Hangzhou", 31000, "CHINA");
        Address address3 = new Address("Renmin Road", "Wenzhou", 325000, "CHINA");

        addresses.Add(address1);
        addresses.Add(address2);
        addresses.Add(address3);

        return addresses;
    }
}